﻿using DataSync.Common;
using DataSync.Entity;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataSync.Proc.Reader
{
    class ConsoleReader : DataSyncReaderBase
    {
        private static ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        protected override int ReadData()
        {
            Console.WriteLine("please input data:");
            int num = 0;
            string line = string.Empty;
            line = Console.ReadLine();
            while (line != "quit" && line != "q")
            {
                var data = new List<Dictionary<string, ColData>>();
                var dic = new Dictionary<string, ColData>();
                dic.Add("data", new ColData() { FieldType = "string", Value = line });
                data.Add(dic);
                this.CurWriter.Execute(data);
                num++;
                line = Console.ReadLine();
            }
            return num;
        }

    }
}
